<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html;charset=utf-8" isELIgnored="false" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  <title>欢迎来到学习页面</title>
  <link rel="icon" href="favicon.ico" type="image/ico">

  <meta name="author" content="yinqi">
  <link href="${base}/css/bootstrap.min.css" rel="stylesheet">
  <link href="${base}/css/materialdesignicons.min.css" rel="stylesheet">
  <link href="${base}/css/style.min.css" rel="stylesheet">
</head>
<style>
  body{
    background-color: #2ad0f4;

  }
</style>
<body>
<div class="container-fluid">

  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-toolbar clearfix">
          <form class="pull-right search-bar" method="get" action="${base}/study/show" role="form">
                <input type="hidden" name="pageNum" value="1">
                文件名<input type="text" name="fname" placeholder="文件名搜索" value="${fname}">
                <input type="submit" onblur="sjm()">
              </form>
        </div>
        <div class="card-body">
          <div class="toolbar-btn-action">
            <a class="btn btn-primary m-r-5" href="${base}/studys/toAdd"><i class="mdi mdi-plus"></i> 新增</a>
          </div>
          <div class="table-responsive">
            <table class="table table-bordered">
              <thead>
              <tr>
                <th>
                  <label class="lyear-checkbox checkbox-primary">
                    <input type="checkbox" id="check-all"><span></span>
                  </label>
                </th>
                <th>标题</th>
                <th>文件名</th>
                <th>更新文件名</th>
                <th>创建时间</th>
                <th>是否共享</th>
                <th>操作</th>
              </tr>
              </thead>
              <tbody>
              <c:forEach var="a" items="${p.list}">
                <tr>
                  <td>
                    <label class="lyear-checkbox checkbox-primary">
                      <input type="checkbox" name="ids[]" value="1"><span></span>
                    </label>
                  </td>
                  <td>${a.note.title}</td>
                  <td>${a.fname}</td>
                  <td>${a.cfile}</td>
                  <td><fmt:formatDate value="${a.upldate}" pattern="yyyy-MM-dd "/></td>
                  <td>${a.note.share}</td>
                  <td>
                    <div class="btn-group">
                      <a class="btn btn-xs btn-default" href="${base}/study/deleteNote?nid&fid=${a.nid}" title="删除" data-toggle="tooltip"><i class="mdi mdi-delete"></i></a>
                      <a class="btn btn-xs btn-default" href="${base}/studys/toshow?nid=${a.nid}" title="查看" data-toggle="tooltip"><i class="mdi mdi-eye"></i></a>
                      <a class="btn btn-xs btn-default" href="${base}/studys/downloadFile" title="下载" data-toggle="tooltip"><i class="mdi mdi-debug-step-into"></i></a>
                    </div>
                  </td>
                </tr>
              </c:forEach>
              </tbody>
            </table>
          </div>
          <div>
            <a class="btn btn-default" href="${pageContext.request.contextPath}/study/toCase">返 回</a>
          </div>
          <ul class="pagination">
            <li><span><a href="${base}/study/show?pageNum=${p.prePage}">«</a></span></li>
            <c:forEach items="${p.navigatepageNums}" var="i">
              <li <c:if test="${i eq p.pageNum}">class="active"</c:if>  ><a href="${base}/study/show?pageNum=${i}">${i}</a></span></li>
            </c:forEach>
            <li><span><a href="${base}/study/show?pageNum=${p.nextPage}">»</a></span></li>
          </ul>

        </div>
      </div>
    </div>

  </div>

</div>

<script type="text/javascript" src="${base}/js/jquery.min.js"></script>
<script type="text/javascript" src="${base}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${base}/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="${base}/js/main.min.js"></script>
<script type="text/javascript">
  $(function(){
    $('.search-bar .dropdown-menu a').click(function() {
      var field = $(this).data('field') || '';
      $('#search-field').val(field);
      $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
    });
  });

  //点击事件
  function sjm() {
    $("#form1").submit();
  }
</script>
</body>
</html>